package com.exam.service.impl;

import com.exam.mapper.ExamManageMapper;
import com.exam.po.ExamManage;
import com.exam.po.ExamManageExample;
import com.exam.service.AdminExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName AdminExamServiceImpl
 * @Description TODO
 * @action luoliang
 * @Data 2021/1/13 11:33
 * @Version 1.0
 */
@Service
public class AdminExamServiceImpl implements AdminExamService {

    @Autowired
    private ExamManageMapper examManageMapper;

    /**
     * 管理员分页查询所有考试
     * @param current
     * @param size
     * @return
     */
    @Override
    public List<ExamManage> findAdminBypage(Integer current, Integer size) {

        return examManageMapper.findAdminBypage(current,size);
    }

    /**
     * 管理员添加考试
     * @param examManage
     * @return
     */
    @Override
    public int AddSelective(ExamManage examManage) {
        return examManageMapper.AddSelective(examManage);
    }

    /**
     * 管理员修改考试
     * @param record
     * @return
     */
    @Override
    public int updateBySelective(ExamManage record) {
        return examManageMapper.updateBySelective(record);
    }

    /**
     * 管理员删除考试
     * @param examcode
     * @return
     */
    @Override
    public int deleteByKey(Integer examcode) {
        return examManageMapper.deleteByKey(examcode);
    }

    /**
     * 管理员审核查询考试
     * @param page
     * @param size
     * @return
     */
    @Override
    public List<ExamManage> selectAdminBypage(Integer page, Integer size) {

        return examManageMapper.selectAdminBypage(page,size);
    }

    /**
     * 管理员审核(为通过)
     * @param examcode
     * @return
     */
    @Override
    public int updateAdminBySelective(Integer examcode) {

        return examManageMapper.updateAdminBySelective(examcode);
    }

    /**
     * 管理员审核(已审核)
     * @param examcode
     * @return
     */
    @Override
    public int updateAdminYiShenHe(Integer examcode) {

        return examManageMapper.updateAdminYiShenHe(examcode);
    }

    /**
     * 查询总条数
     * @param
     * @return
     */
    @Override
    public int countExample() {
        return examManageMapper.countExample();
    }

    @Override
    public int countAdminExample() {
        return examManageMapper.countAdminExample();
    }

    /**
     * 管理员查看所有考试
     * @return
     */
    @Override
    public List<ExamManage> selectAdminExam() {
        return examManageMapper.selectAdminExam();
    }

    /**
     * 根据ID查找
     * @param examcode
     * @return
     */
    @Override
    public ExamManage selectById(Integer examcode) {
        return examManageMapper.selectById(examcode);
    }

    /**
     * 查询最后 一条
     * @return
     */
    @Override
    public ExamManage selectOnlyPaperId() {
        return examManageMapper.selectOnlyPaperId();
    }
}
